<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Tacopie: tacopie::tcp_client Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="tacopie_logo.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Tacopie
   &#160;<span id="projectnumber">3.0.0</span>
   </div>
   <div id="projectbrief">Tacopie is a TCP Client &amp; Server C++11 library.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>tacopie</b></li><li class="navelem"><a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classtacopie_1_1tcp__client-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">tacopie::tcp_client Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="tcp__client_8hpp_source.html">tcp_client.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtacopie_1_1tcp__client_1_1read__request.html">read_request</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtacopie_1_1tcp__client_1_1read__result.html">read_result</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtacopie_1_1tcp__client_1_1write__request.html">write_request</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structtacopie_1_1tcp__client_1_1write__result.html">write_result</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:acdf9dea8bac6c56f7b04ce38b9432322"><td class="memItemLeft" align="right" valign="top">typedef std::function&lt; void(<a class="el" href="structtacopie_1_1tcp__client_1_1read__result.html">read_result</a> &amp;)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#acdf9dea8bac6c56f7b04ce38b9432322">async_read_callback_t</a></td></tr>
<tr class="separator:acdf9dea8bac6c56f7b04ce38b9432322"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad48b8c8dff8a77490eb2e3e802c82b97"><td class="memItemLeft" align="right" valign="top">typedef std::function&lt; void(<a class="el" href="structtacopie_1_1tcp__client_1_1write__result.html">write_result</a> &amp;)&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#ad48b8c8dff8a77490eb2e3e802c82b97">async_write_callback_t</a></td></tr>
<tr class="separator:ad48b8c8dff8a77490eb2e3e802c82b97"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aca5df52e5ee6fa673cf212532ada1453"><td class="memItemLeft" align="right" valign="top">typedef std::function&lt; void()&gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#aca5df52e5ee6fa673cf212532ada1453">disconnection_handler_t</a></td></tr>
<tr class="separator:aca5df52e5ee6fa673cf212532ada1453"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a9293d5ef2b804f17d778504165ba0c52"><td class="memItemLeft" align="right" valign="top"><a id="a9293d5ef2b804f17d778504165ba0c52"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a9293d5ef2b804f17d778504165ba0c52">tcp_client</a> (void)</td></tr>
<tr class="memdesc:a9293d5ef2b804f17d778504165ba0c52"><td class="mdescLeft">&#160;</td><td class="mdescRight">ctor &amp; dtor <br /></td></tr>
<tr class="separator:a9293d5ef2b804f17d778504165ba0c52"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a773fbcbb5b79324c8d065e363de73282"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a773fbcbb5b79324c8d065e363de73282">tcp_client</a> (<a class="el" href="classtacopie_1_1tcp__socket.html">tcp_socket</a> &amp;&amp;socket)</td></tr>
<tr class="separator:a773fbcbb5b79324c8d065e363de73282"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5e326782c52f63814cc8f42a901ffaf6"><td class="memItemLeft" align="right" valign="top"><a id="a5e326782c52f63814cc8f42a901ffaf6"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a5e326782c52f63814cc8f42a901ffaf6">tcp_client</a> (const <a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> &amp;)=delete</td></tr>
<tr class="memdesc:a5e326782c52f63814cc8f42a901ffaf6"><td class="mdescLeft">&#160;</td><td class="mdescRight">copy ctor <br /></td></tr>
<tr class="separator:a5e326782c52f63814cc8f42a901ffaf6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeadcfb8cd727b2917ebcd357311d0a6b"><td class="memItemLeft" align="right" valign="top"><a id="aeadcfb8cd727b2917ebcd357311d0a6b"></a>
<a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#aeadcfb8cd727b2917ebcd357311d0a6b">operator=</a> (const <a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> &amp;)=delete</td></tr>
<tr class="memdesc:aeadcfb8cd727b2917ebcd357311d0a6b"><td class="mdescLeft">&#160;</td><td class="mdescRight">assignment operator <br /></td></tr>
<tr class="separator:aeadcfb8cd727b2917ebcd357311d0a6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7a1796c04efd00542349ecab692e073"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#af7a1796c04efd00542349ecab692e073">operator==</a> (const <a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> &amp;rhs) const</td></tr>
<tr class="separator:af7a1796c04efd00542349ecab692e073"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af352b6b1e939c919aec2761517051eb9"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#af352b6b1e939c919aec2761517051eb9">operator!=</a> (const <a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> &amp;rhs) const</td></tr>
<tr class="separator:af352b6b1e939c919aec2761517051eb9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad38ab710c5eca64de2f887abc455b15d"><td class="memItemLeft" align="right" valign="top">const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#ad38ab710c5eca64de2f887abc455b15d">get_host</a> (void) const</td></tr>
<tr class="separator:ad38ab710c5eca64de2f887abc455b15d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b42ae2afe6d5ee5f2f16b8bd7846f37"><td class="memItemLeft" align="right" valign="top">std::uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a3b42ae2afe6d5ee5f2f16b8bd7846f37">get_port</a> (void) const</td></tr>
<tr class="separator:a3b42ae2afe6d5ee5f2f16b8bd7846f37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cfbb18cb72aa3b6a41921f61cacc425"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a0cfbb18cb72aa3b6a41921f61cacc425">connect</a> (const std::string &amp;host, std::uint32_t port, std::uint32_t timeout_msecs=0)</td></tr>
<tr class="separator:a0cfbb18cb72aa3b6a41921f61cacc425"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7562e0bfa24912595d6f695f848b9e51"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a7562e0bfa24912595d6f695f848b9e51">disconnect</a> (bool wait_for_removal=false)</td></tr>
<tr class="separator:a7562e0bfa24912595d6f695f848b9e51"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9bf568812c8350260843842e7952c8c3"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a9bf568812c8350260843842e7952c8c3">is_connected</a> (void) const</td></tr>
<tr class="separator:a9bf568812c8350260843842e7952c8c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a120e3ec2902acc902f7a0b27074bda6b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a120e3ec2902acc902f7a0b27074bda6b">async_read</a> (const <a class="el" href="structtacopie_1_1tcp__client_1_1read__request.html">read_request</a> &amp;request)</td></tr>
<tr class="separator:a120e3ec2902acc902f7a0b27074bda6b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2304ed6d4ca0cbc74e6aa72d3e92b76a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a2304ed6d4ca0cbc74e6aa72d3e92b76a">async_write</a> (const <a class="el" href="structtacopie_1_1tcp__client_1_1write__request.html">write_request</a> &amp;request)</td></tr>
<tr class="separator:a2304ed6d4ca0cbc74e6aa72d3e92b76a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1a3834deb1d263ec5816066f74286298"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classtacopie_1_1tcp__socket.html">tacopie::tcp_socket</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a1a3834deb1d263ec5816066f74286298">get_socket</a> (void)</td></tr>
<tr class="separator:a1a3834deb1d263ec5816066f74286298"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9cf1f3ccf43f9a0a883a17b15e3668d6"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="classtacopie_1_1tcp__socket.html">tacopie::tcp_socket</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a9cf1f3ccf43f9a0a883a17b15e3668d6">get_socket</a> (void) const</td></tr>
<tr class="separator:a9cf1f3ccf43f9a0a883a17b15e3668d6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aafbf0aa37cd0472778d09fb163362314"><td class="memItemLeft" align="right" valign="top">const std::shared_ptr&lt; <a class="el" href="classtacopie_1_1io__service.html">tacopie::io_service</a> &gt; &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#aafbf0aa37cd0472778d09fb163362314">get_io_service</a> (void) const</td></tr>
<tr class="separator:aafbf0aa37cd0472778d09fb163362314"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c290d681186edb0578051c04f3c0762"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtacopie_1_1tcp__client.html#a8c290d681186edb0578051c04f3c0762">set_on_disconnection_handler</a> (const <a class="el" href="classtacopie_1_1tcp__client.html#aca5df52e5ee6fa673cf212532ada1453">disconnection_handler_t</a> &amp;disconnection_handler)</td></tr>
<tr class="separator:a8c290d681186edb0578051c04f3c0762"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p><a class="el" href="classtacopie_1_1tcp__server.html">tacopie::tcp_server</a> is the class providing TCP Client features. The <a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> works entirely asynchronously </p>
</div><h2 class="groupheader">Member Typedef Documentation</h2>
<a id="acdf9dea8bac6c56f7b04ce38b9432322"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acdf9dea8bac6c56f7b04ce38b9432322">&#9670;&nbsp;</a></span>async_read_callback_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef std::function&lt;void(<a class="el" href="structtacopie_1_1tcp__client_1_1read__result.html">read_result</a>&amp;)&gt; <a class="el" href="classtacopie_1_1tcp__client.html#acdf9dea8bac6c56f7b04ce38b9432322">tacopie::tcp_client::async_read_callback_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>callback to be called on async read completion takes the <a class="el" href="structtacopie_1_1tcp__client_1_1read__result.html">read_result</a> as a parameter </p>

</div>
</div>
<a id="ad48b8c8dff8a77490eb2e3e802c82b97"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad48b8c8dff8a77490eb2e3e802c82b97">&#9670;&nbsp;</a></span>async_write_callback_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef std::function&lt;void(<a class="el" href="structtacopie_1_1tcp__client_1_1write__result.html">write_result</a>&amp;)&gt; <a class="el" href="classtacopie_1_1tcp__client.html#ad48b8c8dff8a77490eb2e3e802c82b97">tacopie::tcp_client::async_write_callback_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>callback to be called on async write completion takes the <a class="el" href="structtacopie_1_1tcp__client_1_1write__result.html">write_result</a> as a parameter </p>

</div>
</div>
<a id="aca5df52e5ee6fa673cf212532ada1453"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aca5df52e5ee6fa673cf212532ada1453">&#9670;&nbsp;</a></span>disconnection_handler_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef std::function&lt;void()&gt; <a class="el" href="classtacopie_1_1tcp__client.html#aca5df52e5ee6fa673cf212532ada1453">tacopie::tcp_client::disconnection_handler_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>disconnection handle called whenever a disconnection occured </p>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a773fbcbb5b79324c8d065e363de73282"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a773fbcbb5b79324c8d065e363de73282">&#9670;&nbsp;</a></span>tcp_client()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">tacopie::tcp_client::tcp_client </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classtacopie_1_1tcp__socket.html">tcp_socket</a> &amp;&amp;&#160;</td>
          <td class="paramname"><em>socket</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">explicit</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>custom ctor build socket from existing socket</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">socket</td><td><a class="el" href="classtacopie_1_1tcp__socket.html">tcp_socket</a> instance to be used for building the client (socket will be moved) </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a120e3ec2902acc902f7a0b27074bda6b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a120e3ec2902acc902f7a0b27074bda6b">&#9670;&nbsp;</a></span>async_read()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tacopie::tcp_client::async_read </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structtacopie_1_1tcp__client_1_1read__request.html">read_request</a> &amp;&#160;</td>
          <td class="paramname"><em>request</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>async read operation</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">request</td><td>read request information </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a2304ed6d4ca0cbc74e6aa72d3e92b76a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2304ed6d4ca0cbc74e6aa72d3e92b76a">&#9670;&nbsp;</a></span>async_write()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tacopie::tcp_client::async_write </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structtacopie_1_1tcp__client_1_1write__request.html">write_request</a> &amp;&#160;</td>
          <td class="paramname"><em>request</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>async write operation</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">request</td><td>write request information </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a0cfbb18cb72aa3b6a41921f61cacc425"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0cfbb18cb72aa3b6a41921f61cacc425">&#9670;&nbsp;</a></span>connect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tacopie::tcp_client::connect </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint32_t&#160;</td>
          <td class="paramname"><em>port</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::uint32_t&#160;</td>
          <td class="paramname"><em>timeout_msecs</em> = <code>0</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Connect the socket to the remote server.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">host</td><td>Hostname of the target server </td></tr>
    <tr><td class="paramname">port</td><td>Port of the target server </td></tr>
    <tr><td class="paramname">timeout_msecs</td><td>maximum time to connect (will block until connect succeed or timeout expire). 0 will block undefinitely. If timeout expires, connection fails </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a7562e0bfa24912595d6f695f848b9e51"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7562e0bfa24912595d6f695f848b9e51">&#9670;&nbsp;</a></span>disconnect()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tacopie::tcp_client::disconnect </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>wait_for_removal</em> = <code>false</code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Disconnect the <a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> if it was currently connected.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">wait_for_removal</td><td>When sets to true, disconnect blocks until the underlying TCP client has been effectively removed from the <a class="el" href="classtacopie_1_1io__service.html">io_service</a> and that all the underlying callbacks have completed. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ad38ab710c5eca64de2f887abc455b15d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad38ab710c5eca64de2f887abc455b15d">&#9670;&nbsp;</a></span>get_host()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::string&amp; tacopie::tcp_client::get_host </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the hostname associated with the underlying socket. </dd></dl>

</div>
</div>
<a id="aafbf0aa37cd0472778d09fb163362314"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aafbf0aa37cd0472778d09fb163362314">&#9670;&nbsp;</a></span>get_io_service()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const std::shared_ptr&lt;<a class="el" href="classtacopie_1_1io__service.html">tacopie::io_service</a>&gt;&amp; tacopie::tcp_client::get_io_service </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>io service monitoring this tcp connection </dd></dl>

</div>
</div>
<a id="a3b42ae2afe6d5ee5f2f16b8bd7846f37"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b42ae2afe6d5ee5f2f16b8bd7846f37">&#9670;&nbsp;</a></span>get_port()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::uint32_t tacopie::tcp_client::get_port </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>the port associated with the underlying socket. </dd></dl>

</div>
</div>
<a id="a1a3834deb1d263ec5816066f74286298"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1a3834deb1d263ec5816066f74286298">&#9670;&nbsp;</a></span>get_socket() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classtacopie_1_1tcp__socket.html">tacopie::tcp_socket</a>&amp; tacopie::tcp_client::get_socket </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>underlying <a class="el" href="classtacopie_1_1tcp__socket.html">tcp_socket</a> (non-const version) </dd></dl>

</div>
</div>
<a id="a9cf1f3ccf43f9a0a883a17b15e3668d6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9cf1f3ccf43f9a0a883a17b15e3668d6">&#9670;&nbsp;</a></span>get_socket() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const <a class="el" href="classtacopie_1_1tcp__socket.html">tacopie::tcp_socket</a>&amp; tacopie::tcp_client::get_socket </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>underlying <a class="el" href="classtacopie_1_1tcp__socket.html">tcp_socket</a> (const version) </dd></dl>

</div>
</div>
<a id="a9bf568812c8350260843842e7952c8c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9bf568812c8350260843842e7952c8c3">&#9670;&nbsp;</a></span>is_connected()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool tacopie::tcp_client::is_connected </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<dl class="section return"><dt>Returns</dt><dd>whether the client is currently connected or not </dd></dl>

</div>
</div>
<a id="af352b6b1e939c919aec2761517051eb9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af352b6b1e939c919aec2761517051eb9">&#9670;&nbsp;</a></span>operator!=()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool tacopie::tcp_client::operator!= </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>comparison operator</p>
<dl class="section return"><dt>Returns</dt><dd>true when the underlying sockets are different (different file descriptor or socket type). </dd></dl>

</div>
</div>
<a id="af7a1796c04efd00542349ecab692e073"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7a1796c04efd00542349ecab692e073">&#9670;&nbsp;</a></span>operator==()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool tacopie::tcp_client::operator== </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classtacopie_1_1tcp__client.html">tcp_client</a> &amp;&#160;</td>
          <td class="paramname"><em>rhs</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>comparison operator</p>
<dl class="section return"><dt>Returns</dt><dd>true when the underlying sockets are the same (same file descriptor and socket type). </dd></dl>

</div>
</div>
<a id="a8c290d681186edb0578051c04f3c0762"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8c290d681186edb0578051c04f3c0762">&#9670;&nbsp;</a></span>set_on_disconnection_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void tacopie::tcp_client::set_on_disconnection_handler </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classtacopie_1_1tcp__client.html#aca5df52e5ee6fa673cf212532ada1453">disconnection_handler_t</a> &amp;&#160;</td>
          <td class="paramname"><em>disconnection_handler</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>set on disconnection handler</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">disconnection_handler</td><td>the handler to be called on disconnection </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>includes/tacopie/network/<a class="el" href="tcp__client_8hpp_source.html">tcp_client.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
